package com.yuanli.cosmeticmirror.persenter;

import androidx.lifecycle.LifecycleOwner;

import com.alibaba.fastjson.JSON;
import com.comenjoysoft.baselibrary.listener.CallbackListener;
import com.comenjoysoft.baselibrary.presenter.BasePresenter;
import com.comenjoysoft.baselibrary.util.SPUtils;
import com.tsy.sdk.pay.alipay.Alipay;
import com.tsy.sdk.pay.weixin.WXPay;
import com.yuanli.cosmeticmirror.base.Constant;
import com.yuanli.cosmeticmirror.base.MyApp;
import com.yuanli.cosmeticmirror.base.WxConstant;
import com.yuanli.cosmeticmirror.bean.AlipayBean;
import com.yuanli.cosmeticmirror.bean.MemberBean;
import com.yuanli.cosmeticmirror.bean.MemberInfoBean;
import com.yuanli.cosmeticmirror.model.biz.IMemberBiz;
import com.yuanli.cosmeticmirror.model.impl.MemberImpl;
import com.yuanli.cosmeticmirror.model.iview.IMainView;
import com.yuanli.cosmeticmirror.model.iview.IMemberView;
import com.yuanli.cosmeticmirror.utils.CommonUtils;

import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

public class MainPersenter extends BasePresenter<IMainView> {
    private IMemberBiz biz;

    public MainPersenter(IMainView view, LifecycleOwner owner) {
        attachView(view);
        biz = new MemberImpl(owner);
    }

    public void getVipInfo() {
        biz.getVipInfo(new CallbackListener<MemberInfoBean>() {
            @Override
            public void success(MemberInfoBean object) {
                mView.onVipSucess(object);
            }

            @Override
            public void failed(Object object) {
                mView.onVipSucess(null);
            }
        });
    }
}
